home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / textview / comp.sys.handhelds_5696_000000.msg
Text File  |  1995-03-31  |  5KB  |  164 lines

  1. Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!usc!wuarchive!psuvax1!rutgers!maverick.ksu.ksu.edu!uafhp!engr.uark.edu!dhe
  2. From: dhe@engr.uark.edu (David Ewing)
  3. Newsgroups: comp.sys.handhelds
  4. Subject: HP48SX PROGRAM: TEXTVIEW
  5. Keywords: Nice Text Utility
  6. Message-ID: <6260@uafhp.uark.edu>
  7. Date: 9 Apr 91 00:48:29 GMT
  8. Sender: netnews@uafhp.uark.edu
  9. Lines: 153
  10.  
  11.  
  12. HP48sx Program : TEXTVIEW
  13. ---------------------------------------------------------------------
  14.  
  15. Ever wished for a better way to view a large text string containing 
  16. new lines as if it was a 'text document'?  Well, this program may be 
  17. what you've been looking for.
  18.  
  19. TEXTVIEW: A String viewing utility.
  20.  
  21.    TEXTVIEW requires string that you wish to view on the stack - 
  22. an error message will be displayed otherwise.  The string may contain 
  23. any number of new line characters (which of course indicate the end of 
  24. a line) and any number of characters per line (within memory limits), 
  25. but only 32 characters can be displayed per line.
  26.  
  27.    Once TEXTVIEW is started it will analyze the string for lines, 
  28. the results of which are briefly displayed on the top line along with 
  29. the string size.  After all the program initialization is complete, 
  30. which will depend on the string size, the screen will display the first 
  31. ten lines using the smallest text font; the smallest font is used to 
  32. display the most on the screen at once, however the only drawback is 
  33. that all the characters are displayed only in upper case.  Six keys on 
  34. the keyboard now become active at this point:
  35.  
  36.  Arrow up             :  Up one page   (if not at the beginning)
  37.  Arrow down           :  Down one page (if not at the end)
  38.  Arrow left           :  Top of string/document
  39.  Arrow right          :  Bottom of string/document
  40.  Enter                :  Exit TEXTVIEW program
  41.  Blue/Right-Shift On  :  Turns off Calculator -Pressing ON resumes.
  42.  
  43.      (Pressing any other key simply refreshes the screen just
  44.       to let you know that the HP really felt you press a
  45.       mostly-dead key :-)
  46.  
  47. As always in RPL programs, ON is active - but not really recommended as 
  48. an exit since it will leave one or two objects of its own on the stack.
  49. TEXTVIEW will also not erase anything that was previously on the stack
  50. besides the object that you wished to view.
  51.  
  52.  
  53.      VERY QUICK OPERATION SUMMARY:
  54. --------------------------------------
  55. On Stack Level 1:  A string   (e.g. "This is a string
  56.                                      with a line-feed in it")
  57. Press the TEXTVIEW menu key or type 'TEXTVIEW'.
  58. Arrow keys acts as page up and down, and ENTER quits
  59.  
  60.  
  61.      TO INSTALL:
  62. ---------------------
  63.    Simply strip off all this documentation until only the program
  64. remains, then set the HP48 for a ASC transfer with translate code
  65. 3 set, and finally send it to the calculator.   I recommend putting
  66. it in the HOME directory so that it is available anywhere in the
  67. directory structure.
  68.  
  69.  
  70.      COMING SOON (probably after this post!)
  71. ----------------------------------------------
  72.      TCAT: A text string catalog program; Nice User interface for
  73.            navigating directories and selecting a string variable 
  74.        to view using this TEXTVIEW program.
  75.  
  76. #include <disclaimer.h>
  77.   "...this program shouldn't in anyway damage data, and if it does
  78.    I can't be held responsible - blame some other program...."  :-)
  79.  
  80.         -David
  81.  
  82. ==============================================================================
  83.  dhe@engr.uark.edu                        David Ewing, University of Arkansas
  84.  dewing@uafhp.uark.edu                        Computer Science Engineering
  85.  
  86. Ensign, if you encounter any holes...steer clear.
  87.     -- Riker to Wesley, "Where Silence Has Lease",
  88.         stardate 42193.6
  89. ==============================================================================
  90.  
  91. --------------------->Cut Here and Download to HP<-------------------
  92. %%HP: T(3)A(D)F(.);
  93. \<< 0 1 1 1 1 0 \-> S a
  94. b c l m
  95.   \<< CLLCD ERASE DUP
  96. TYPE
  97.     IF 2 \=/
  98.     THEN DROP
  99. "Invalid Object Type"
  100. DOERR
  101.     END 'S' STO S
  102. "
  103. " + 'S' STO S
  104. SIZE 'l' STO
  105. "Size:" l \->STR + 1
  106. DISP
  107.     WHILE S "
  108. " POS
  109. DUP 'b' STO 0 >
  110.     REPEAT S c b 1
  111. - SUB S b 1 + l SUB
  112. 'S' STO 'm' 1 STO+
  113.     END "Lines:" m
  114. \->STR + 2 DISP m
  115. \->LIST 'S' STO 0 'l'
  116. STO
  117.     DO 1 l + m l -
  118. 10 MIN l +
  119.       FOR a S a GET
  120. 1 \->GROB PICT SWAP a
  121. 1 + 'b' STO # 0d a
  122. l - 1 - 6 * R\->B 2
  123. \->LIST SWAP REPL
  124.       NEXT { # 0d
  125. # 0d } PVIEW 0 WAIT
  126. DUP { 25.1 35.1
  127. 34.1 91.3 36.1 51.1
  128. } SWAP POS DUP
  129.       IF 0 \=/
  130.       THEN ERASE {
  131.         \<<
  132.           IF l 0 >
  133.           THEN 'l'
  134. 10 STO-
  135.           END
  136.         \>>
  137.         \<<
  138.           IF l m 1
  139. - 10 / IP 10 * <
  140.           THEN 'l'
  141. 10 STO+
  142.           END
  143.         \>>
  144.         \<< 0 'l' STO
  145.         \>>
  146.         \<< OFF
  147.         \>>
  148.         \<<
  149.           WHILE l m
  150. 1 - 10 / IP 10 * <
  151.           REPEAT 1
  152. 'l' STO+
  153.           END
  154.         \>>
  155.         \<<
  156.         \>> } SWAP
  157. GET EVAL
  158.       ELSE DROP
  159.       END
  160.     UNTIL 51.1 ==
  161.     END
  162.   \>>
  163. \>>
  164.